# This sample code supports Appium Python client >=2.3.0
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
import time

from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy

# For W3C actions
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
from selenium.webdriver.common.actions.pointer_input import PointerInput

options = AppiumOptions()
options.load_capabilities({
	"platformName": "Android",
	"appium:platformVersion": "13",
	"appium:deviceName": "eyc6spinnnmw4h89",
	"appium:appPackage": "com.xingin.xhs",
	"appium:appActivity": "com.xingin.xhs.index.v2.IndexActivityV2",
	"appium:noReset": True,
	"appium:automationName": "UiAutomator2",
	"appium:ensureWebviewsHavePages": True,
	"appium:nativeWebScreenshot": True,
	"appium:newCommandTimeout": 3600,
	"appium:connectHardwareKeyboard": True
})

driver = webdriver.Remote("http://localhost:4723/wd/hub", options=options)
el1 = driver.find_element(by=AppiumBy.ANDROID_UIAUTOMATOR, value="new UiSelector().text(\"我\")")
el1.click()
time.sleep(5)
el3 = driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value="1粉丝")
el3.click()
time.sleep(5)

driver.quit()